-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'nosplitscroll' poblems #11117
Fix 'nosplitscroll' poblems #11117
Conversation
Problem: w_prev_height may be wrong when adding laststatus or winbar. Solution: Initialize w_prev_height and update it when setting laststatus or winbar. Also delay intializing firstwin size until after gui has started.
Codecov Report
@@ Coverage Diff @@
## master #11117 +/- ##
==========================================
- Coverage 81.80% 81.77% -0.03%
==========================================
Files 162 162
Lines 188276 188294 +18
Branches 42822 42826 +4
==========================================
- Hits 154015 153982 -33
- Misses 21725 21769 +44
- Partials 12536 12543 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
One related test is failing, perhaps it is flaky? |
Yeah I noticed, not sure what could cause it. I have no idea how this test could fail on only a single platform. |
I've never seen it be flaky while developing the patch. I have had iterations of the patch where it would pass on terminal but fail on gui. It's the first time I've seen it fail on just a single platform so it seems unlikely that it would be flaky... On second thought I can imagine this change making it flaky. I suspect it has something to do with the reason for my delaying the win_init_size() call. I guess there is another point where the gui size might change(why?). Perhaps we could flag it flaky for just gui? |
Or perhaps we just need a |
Problem: Lines are scrolled when snapshot is restored. Solution: Call win_fix_scroll() in restore_snapshot() (closes vim#11115).
345a825
to
8e1cde6
Compare
Was able to reproduce some flakiness by running the test with gvim in a floating window(as opposed to tiled by my window manager, which is what I had done up till now). Test seems to pass now with some redraws added in the latest commit. It seems disabling gui scrollbars with 'guioptions' for gvim stops the window from resizing unexpectedly. Might be worth setting guioptions if this test causes more problems but it works for now... |
vim-patch:9.0.0445: when opening/closing window text moves up/down Problem: When opening/closing window text moves up/down. Solution: Add the 'splitscroll' option. When off text will keep its position as much as possible. vim/vim@29ab524 vim-patch:9.0.0455: a few problems with 'splitscroll' Problem: A few problems with 'splitscroll'. Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117) vim/vim@5ed3917 vim-patch:9.0.0461: 'scroll' is not always updated Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. vim/vim@470a141 vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off. Solution: Temporarily set 'splitscroll' when jumping back to the original window. (closes vim/vim#11128) vim/vim@e697d48 vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off. Solution: Skip win_fix_cursor if called when cmdwin is open or closing. (Luuk van Baal, closes vim/vim#11134) vim/vim@3735f11 vim-patch:9.0.0478: test for 'splitscroll' takes too much time Problem: Test for 'splitscroll' takes too much time. Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139) vim/vim@594f9e0 vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help window closed. Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal, closes vim/vim#11150) vim/vim@d5bc762 vim-patch:9.0.0505: various problems with 'nosplitscroll' Problem: Various problems with 'nosplitscroll'. Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166) vim/vim@faf1d41 vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin Problem: Scrolling with 'nosplitscroll' in callback changing curwin. Solution: Invalidate w_cline_row in the right place. (Luuk van Baal, closes vim/vim#11185) vim/vim@20e5856 vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly Problem: With 'nosplitscroll' folds are not handled correctly. Solution: Take care of closed folds when moving the cursor. (Luuk van Baal, closes vim/vim#11234) vim/vim@7c1cbb6 vim-patch:9.0.0605: dump file missing Problem: Dump file missing. Solution: Add the missing dump file. (issue vim/vim#11234) vim/vim@439a2ba vim-patch:9.0.0647: the 'splitscroll' option is not a good name Problem: The 'splitscroll' option is not a good name. Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option, also supporting "topline". (Luuk van Baal, closes vim/vim#11258) vim/vim@13ece2a vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen" Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas) Solution: Check the botline is not too large. (Luuk van Baal, closes vim/vim#11293, closes vim/vim#11292) vim/vim@346823d
vim-patch:9.0.0445: when opening/closing window text moves up/down Problem: When opening/closing window text moves up/down. Solution: Add the 'splitscroll' option. When off text will keep its position as much as possible. vim/vim@29ab524 vim-patch:9.0.0455: a few problems with 'splitscroll' Problem: A few problems with 'splitscroll'. Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117) vim/vim@5ed3917 vim-patch:9.0.0461: 'scroll' is not always updated Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. vim/vim@470a141 vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off. Solution: Temporarily set 'splitscroll' when jumping back to the original window. (closes vim/vim#11128) vim/vim@e697d48 vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off. Solution: Skip win_fix_cursor if called when cmdwin is open or closing. (Luuk van Baal, closes vim/vim#11134) vim/vim@3735f11 vim-patch:9.0.0478: test for 'splitscroll' takes too much time Problem: Test for 'splitscroll' takes too much time. Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139) vim/vim@594f9e0 vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help window closed. Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal, closes vim/vim#11150) vim/vim@d5bc762 vim-patch:9.0.0505: various problems with 'nosplitscroll' Problem: Various problems with 'nosplitscroll'. Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166) vim/vim@faf1d41 vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin Problem: Scrolling with 'nosplitscroll' in callback changing curwin. Solution: Invalidate w_cline_row in the right place. (Luuk van Baal, closes vim/vim#11185) vim/vim@20e5856 vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly Problem: With 'nosplitscroll' folds are not handled correctly. Solution: Take care of closed folds when moving the cursor. (Luuk van Baal, closes vim/vim#11234) vim/vim@7c1cbb6 vim-patch:9.0.0605: dump file missing Problem: Dump file missing. Solution: Add the missing dump file. (issue vim/vim#11234) vim/vim@439a2ba vim-patch:9.0.0647: the 'splitscroll' option is not a good name Problem: The 'splitscroll' option is not a good name. Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option, also supporting "topline". (Luuk van Baal, closes vim/vim#11258) vim/vim@13ece2a vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen" Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas) Solution: Check the botline is not too large. (Luuk van Baal, closes vim/vim#11293, closes vim/vim#11292) vim/vim@346823d
Problem: w_prev_height may be wrong when adding laststatus or winbar.
Solution: Initialize w_prev_height and update it when setting laststatus or winbar. Also delay initializing firstwin size until after gui has started.
Instead of having a separate case in win_fix_scroll() for when w_prev_height was uninitialized, we now initialize it in win_init_size(). This prevents scrolling for the first split when 'nosplitbelow' is set. Slipped through the cracks as this only happens for the first window in a new tab when the first split is horizontal. Might be considered hair splitting again but I feel this is more correct and not too involved.
I don't think this addresses #11115 yet. Feel free to keep this open and I'll add the fix to that if I find it.Added a commit that should fix #11115.